Skip to content

fix(composer): keep the gap after inline chips - #204

Merged
Tarquinen merged 2 commits into
devfrom
fix/skill-chip-overlap
Nov 20, 2026
Merged

Tarquinen merged 2 commits into
devfrom
fix/skill-chip-overlap

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

When text follows an inline chip, it slid under the chip. Type we after a skill chip and the chip covered the w, though the draft text was right.

The output transformation in AutocompleteViews.kt styled the chip (transparent text, plus letter spacing that reserves the chip's width) and then replaced the token with its non-breaking form. TextFieldBuffer.replace drops the styles in the range it replaces, so the reserved width was lost. Now it replaces first and styles after. Thanks to @BurgessTG, whose diagnosis in the issue was right.

Before After
Before, light After, light
Before, dark After, dark

Skill, file and agent chips at the start of the draft, in a row, and wrapping to a second line:

Edge cases

Verified on the emulator against session-lab: skill, file and agent chips at the start, middle and end of the draft, chips in a row, wrapping chips, font scale 1.3, and one backspace deleting a chip.

Fixes #199

The composer's output transformation added the chip's transparent and
letter-spacing styles, then replaced the chip text with its non-breaking
form. TextFieldBuffer.replace drops the styles in the replaced range, so
the extra spacing that reserves the chip's width was lost and text typed
after a chip slid under it. Replace first, then style.

Verified on the emulator (session-lab): skill, file and agent chips at the
start, middle and end of a draft, chips in a row, wrapping chips, font
scale 1.3, and single backspace deleting a chip. New test
inlineSkillChipKeepsTheSpaceBeforeFollowingText fails without the fix.
scripts/check.sh :feature:composer passes.

Fixes #199
Keeps the PR to the one-line reorder in AutocompleteViews.kt.
@Tarquinen
Tarquinen enabled auto-merge (squash) November 20, 2026 16:57
@Tarquinen
Tarquinen merged commit 40fce33 into dev Nov 20, 2026
2 checks passed
@Tarquinen
Tarquinen deleted the fix/skill-chip-overlap branch November 20, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android composer: text overlaps inline skill chips

1 participant